<?php
namespace Modules\Skinov\Controllers;

class ControllerBase extends \Phalcon\Mvc\Controller {
  use \Components\Traits\ControllerBaseTraits;

  protected function _returnScript($message, $url = null) {
    $this -> response -> setContentType('text/html', 'UTF-8') -> setContent('<script type="text/javascript">');

    $this -> response -> appendContent('alert("' . $message . '");');

    if(is_null($url)) { $this -> response -> appendContent('window.history.back();'); }
    else { $this -> response -> appendContent('window.location.href="' . $url . '"'); }

    $this -> response -> appendContent('</script>');

    return $this -> response;
  }
}
